﻿// -----------------------------------------------------------------------
// <copyright file="Directory.cs" company="Company">
// Company 2011
// </copyright>
// -----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.AccessControl;
using Company.Common.Helper;
using Company.IO.Interfaces;

namespace Company.System.IO
{
    /// <summary>
    ///     Exposes methods for creating, moving, and enumerating through directories and subdirectories. This class cannot be
    ///     inherited.
    /// </summary>
    [Guid("3b4d84af-31a6-4b2d-8572-9470aae6d2b7")]
    public sealed class Directory : IDirectory
    {
        /// <summary>
        ///     Initializes a new instance of the Directory class
        /// </summary>
        public Directory()
            : this(new SystemIoConverter())
        {
        }

        /// <summary>
        ///     Initializes a new instance of the Directory class
        /// </summary>
        /// <param name="systemIoConverter">The ISystemConverzter to use</param>
        /// <exception cref="ArgumentNullException">if the systemIoConverter is null</exception>
        [DebuggerHidden]
        public Directory(ISystemIoConverter systemIoConverter)
        {
            CompanyContract.ThrowIfNull(systemIoConverter, "systemIoConverter");

            IoConverter = systemIoConverter;
        }

        /// <summary>
        ///     Get or set the converter
        /// </summary>
        private ISystemIoConverter IoConverter { get; set; }

        #region IDirectory Members

        /// <summary>
        ///     Get the DirectoryInfo from the given Path
        /// </summary>
        /// <param name="path">The path to get the info from</param>
        /// <returns>
        ///     The given directory,
        ///     including the root of a UNC server or share name.
        /// </returns>
        [DebuggerHidden]
        IDirectoryInfo IDirectory.GetDirectoryInfo(string path)
        {
            return Convert(new global::System.IO.DirectoryInfo(path));
        }

        /// <summary>
        ///     Get the Parent from given Path
        /// </summary>
        /// <param name="path">The path to get the Parent from</param>
        /// <returns>
        ///     The parent directory, or a null reference (Nothing in Visual Basic) if path is the root directory,
        ///     including the root of a UNC server or share name.
        /// </returns>
        /// <exception cref="IOException">The directory specified by path is read-only.</exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string,
        ///     contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path was not found.</exception>
        [DebuggerHidden]
        IDirectoryInfo IDirectory.GetParent(string path)
        {
            return Convert(global::System.IO.Directory.GetParent(path));
        }

        /// <summary>
        ///     Create the Directory from given Path
        /// </summary>
        /// <param name="path">The directory to create.</param>
        /// <returns>
        ///     A IDirectoryInfo object representing the newly created directory.
        /// </returns>
        /// <exception cref="IOException">
        ///     <para>The directory specified by path is a file.</para>
        ///     <para>-or-</para>
        ///     <para>The network name is not known.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     <para>
        ///         path is a zero-length string, contains only white space, or contains one or more invalid characters as
        ///         defined by InvalidPathChars.
        ///     </para>
        ///     <para>-or-</para>
        ///     <para>path is prefixed with, or contains only a colon character (:).</para>
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path was not found.</exception>
        /// <exception cref="NotSupportedException">path contains a colon character (:) that is not part of a drive label ("C:\").</exception>
        [DebuggerHidden]
        IDirectoryInfo IDirectory.CreateDirectory(string path)
        {
            return Convert(global::System.IO.Directory.CreateDirectory(path));
        }

        /// <summary>
        ///     Create the Directory from given Path
        /// </summary>
        /// <param name="path">The directory to create.</param>
        /// <param name="directorySecurity">The access control to apply to the directory.</param>
        /// <returns>
        ///     A IDirectoryInfo object representing the newly created directory.
        /// </returns>
        /// <exception cref="IOException">
        ///     <para>The directory specified by path is a file.</para>
        ///     <para>-or-</para>
        ///     <para>The network name is not known.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     <para>
        ///         path is a zero-length string, contains only white space, or contains one or more invalid characters as
        ///         defined by InvalidPathChars.
        ///     </para>
        ///     <para>-or-</para>
        ///     <para>path is prefixed with, or contains only a colon character (:).</para>
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path was not found.</exception>
        /// <exception cref="NotSupportedException">path contains a colon character (:) that is not part of a drive label ("C:\").</exception>
        [DebuggerHidden]
        IDirectoryInfo IDirectory.CreateDirectory(string path, DirectorySecurity directorySecurity)
        {
            return Convert(global::System.IO.Directory.CreateDirectory(path, directorySecurity));
        }

        /// <summary>
        ///     Determines whether the given path refers to an existing directory on disk.
        /// </summary>
        /// <param name="path">The path to test.</param>
        /// <returns>true if path refers to an existing directory; otherwise, false</returns>
        [DebuggerHidden]
        bool IDirectory.Exists(string path)
        {
            return global::System.IO.Directory.Exists(path);
        }

        /// <summary>
        ///     Sets the creation date and time for the specified file or directory.
        /// </summary>
        /// <param name="path">The file or directory for which to set the creation date and time information.</param>
        /// <param name="creationTime">
        ///     A System.DateTime containing the value to set for the creation date and time of path. This
        ///     value is expressed in local time.
        /// </param>
        /// <exception cref="FileNotFoundException">The specified path was not found.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length. For example,
        ///     on Windows-based platforms, paths must be less than 248 characters and file names must be less
        ///     than 260 characters.
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentOutOfRangeException">
        ///     creationTime specifies a value outside the range of dates or times permitted for this operation.
        /// </exception>
        /// <exception cref="PlatformNotSupportedException">The current operating system is not Windows NT or later.</exception>
        [DebuggerHidden]
        void IDirectory.SetCreationTime(string path, DateTime creationTime)
        {
            global::System.IO.Directory.SetCreationTime(path, creationTime);
        }

        /// <summary>
        ///     Sets the creation date and time, in Coordinated Universal Time (UTC) format, for the specified file or directory.
        /// </summary>
        /// <param name="path">The file or directory for which to set the creation date and time information.</param>
        /// <param name="creationTimeUtc">
        ///     A System.DateTime containing the value to set for the creation date and time of path.
        ///     This value is expressed in UTC time.
        /// </param>
        /// <exception cref="FileNotFoundException">The specified path was not found.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length. For example,
        ///     on Windows-based platforms, paths must be less than 248 characters and file names must be less
        ///     than 260 characters.
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentOutOfRangeException">
        ///     creationTime specifies a value outside the range of dates or times permitted for this operation.
        /// </exception>
        /// <exception cref="PlatformNotSupportedException">The current operating system is not Windows NT or later.</exception>
        [DebuggerHidden]
        void IDirectory.SetCreationTimeUtc(string path, DateTime creationTimeUtc)
        {
            global::System.IO.Directory.SetCreationTimeUtc(path, creationTimeUtc);
        }

        /// <summary>
        ///     Gets the creation date and time of a directory.
        /// </summary>
        /// <param name="path">The path of the directory.</param>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length. For example,
        ///     on Windows-based platforms, paths must be less than 248 characters and file names must be less
        ///     than 260 characters.
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <returns>
        ///     A System.DateTime structure set to the creation date and time for the specified directory. This value is
        ///     expressed in local time.
        /// </returns>
        [DebuggerHidden]
        DateTime IDirectory.GetCreationTime(string path)
        {
            return global::System.IO.Directory.GetCreationTime(path);
        }

        /// <summary>
        ///     Gets the creation date and time, in Coordinated Universal Time (UTC) format, of a directory.
        /// </summary>
        /// <param name="path">The path of the directory.</param>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length. For example,
        ///     on Windows-based platforms, paths must be less than 248 characters and file names must be less
        ///     than 260 characters.
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <returns>
        ///     A System.DateTime structure set to the creation date and time for the specified directory. This value is
        ///     expressed in UTC time.
        /// </returns>
        [DebuggerHidden]
        DateTime IDirectory.GetCreationTimeUtc(string path)
        {
            return global::System.IO.Directory.GetCreationTimeUtc(path);
        }

        /// <summary>
        ///     Sets the date and time a directory was last written to.
        /// </summary>
        /// <param name="path">The path of the directory.</param>
        /// <param name="lastWriteTime">The date and time the directory was last written to. This value is expressed in local time.</param>
        /// <exception cref="FileNotFoundException">The specified path was not found.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length. For example,
        ///     on Windows-based platforms, paths must be less than 248 characters and file names must be less
        ///     than 260 characters.
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentOutOfRangeException">
        ///     creationTime specifies a value outside the range of dates or times permitted for this operation.
        /// </exception>
        /// <exception cref="PlatformNotSupportedException">The current operating system is not Windows NT or later.</exception>
        [DebuggerHidden]
        void IDirectory.SetLastWriteTime(string path, DateTime lastWriteTime)
        {
            global::System.IO.Directory.SetLastWriteTime(path, lastWriteTime);
        }

        /// <summary>
        ///     Sets the date and time, in Coordinated Universal Time (UTC) format, that a directory was last written to.
        /// </summary>
        /// <param name="path">The path of the directory.</param>
        /// <param name="lastWriteTimeUtc">
        ///     The date and time the directory was last written to. This value is expressed in UTC
        ///     time.
        /// </param>
        /// <exception cref="FileNotFoundException">The specified path was not found.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length. For example,
        ///     on Windows-based platforms, paths must be less than 248 characters and file names must be less
        ///     than 260 characters.
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentOutOfRangeException">
        ///     creationTime specifies a value outside the range of dates or times permitted for this operation.
        /// </exception>
        /// <exception cref="PlatformNotSupportedException">The current operating system is not Windows NT or later.</exception>
        [DebuggerHidden]
        void IDirectory.SetLastWriteTimeUtc(string path, DateTime lastWriteTimeUtc)
        {
            global::System.IO.Directory.SetLastWriteTimeUtc(path, lastWriteTimeUtc);
        }

        /// <summary>
        ///     Returns the date and time the specified file or directory was last written to.
        /// </summary>
        /// <param name="path">The file or directory for which to obtain modification date and time information.</param>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length. For example,
        ///     on Windows-based platforms, paths must be less than 248 characters and file names must be less
        ///     than 260 characters.
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <returns>
        ///     A System.DateTime structure set to the date and time the specified file or directory was last written to. This
        ///     value is expressed in local time.
        /// </returns>
        [DebuggerHidden]
        DateTime IDirectory.GetLastWriteTime(string path)
        {
            return global::System.IO.Directory.GetLastWriteTime(path);
        }

        /// <summary>
        ///     Returns the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was
        ///     last written to.
        /// </summary>
        /// <param name="path">The file or directory for which to obtain modification date and time information.</param>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length. For example,
        ///     on Windows-based platforms, paths must be less than 248 characters and file names must be less
        ///     than 260 characters.
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <returns>
        ///     A System.DateTime structure set to the date and time the specified file or directory was last written to. This
        ///     value is expressed in UTC time.
        /// </returns>
        [DebuggerHidden]
        DateTime IDirectory.GetLastWriteTimeUtc(string path)
        {
            return global::System.IO.Directory.GetLastWriteTimeUtc(path);
        }

        /// <summary>
        ///     Sets the date and time the specified file or directory was last accessed.
        /// </summary>
        /// <param name="path">The file or directory for which to set the access date and time information.</param>
        /// <param name="lastAccessTime">
        ///     A System.DateTime containing the value to set for the access date and time of path.
        ///     This value is expressed in local time.
        /// </param>
        /// <exception cref="FileNotFoundException">The specified path was not found.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length. For example,
        ///     on Windows-based platforms, paths must be less than 248 characters and file names must be less
        ///     than 260 characters.
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentOutOfRangeException">
        ///     creationTime specifies a value outside the range of dates or times permitted for this operation.
        /// </exception>
        /// <exception cref="PlatformNotSupportedException">The current operating system is not Windows NT or later.</exception>
        [DebuggerHidden]
        void IDirectory.SetLastAccessTime(string path, DateTime lastAccessTime)
        {
            global::System.IO.Directory.SetLastAccessTime(path, lastAccessTime);
        }

        /// <summary>
        ///     Sets the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last
        ///     accessed.
        /// </summary>
        /// <param name="path">The file or directory for which to set the access date and time information.</param>
        /// <param name="lastAccessTimeUtc">
        ///     A System.DateTime containing the value to set for the access date and time of path.
        ///     This value is expressed in UTC time.
        /// </param>
        /// <exception cref="FileNotFoundException">The specified path was not found.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length. For example,
        ///     on Windows-based platforms, paths must be less than 248 characters and file names must be less
        ///     than 260 characters.
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentOutOfRangeException">
        ///     creationTime specifies a value outside the range of dates or times permitted for this operation.
        /// </exception>
        /// <exception cref="PlatformNotSupportedException">The current operating system is not Windows NT or later.</exception>
        [DebuggerHidden]
        void IDirectory.SetLastAccessTimeUtc(string path, DateTime lastAccessTimeUtc)
        {
            global::System.IO.Directory.SetLastAccessTimeUtc(path, lastAccessTimeUtc);
        }

        /// <summary>
        ///     Returns the date and time the specified file or directory was last accessed.
        /// </summary>
        /// <param name="path">The file or directory for which to obtain access date and time information.</param>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length. For example,
        ///     on Windows-based platforms, paths must be less than 248 characters and file names must be less
        ///     than 260 characters.
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <returns>
        ///     A System.DateTime structure set to the date and time the specified file or directory was last accessed.
        ///     This value is expressed in local time.
        /// </returns>
        [DebuggerHidden]
        DateTime IDirectory.GetLastAccessTime(string path)
        {
            return global::System.IO.Directory.GetLastAccessTime(path);
        }

        /// <summary>
        ///     Returns the date and time, in Coordinated Universal Time (UTC) format,
        ///     that the specified file or directory was last accessed.
        /// </summary>
        /// <param name="path">The file or directory for which to obtain access date and time information.</param>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length. For example,
        ///     on Windows-based platforms, paths must be less than 248 characters and file names must be less
        ///     than 260 characters.
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <returns>
        ///     A System.DateTime structure set to the date and time the specified file or directory was last accessed.
        ///     This value is expressed in UTC time.
        /// </returns>
        [DebuggerHidden]
        DateTime IDirectory.GetLastAccessTimeUtc(string path)
        {
            return global::System.IO.Directory.GetLastAccessTimeUtc(path);
        }

        /// <summary>
        ///     Gets a DirectorySecurity object that encapsulates the access control list (ACL)
        ///     entries for a specified directory.
        /// </summary>
        /// <param name="path">
        ///     The path to a directory containing a DirectorySecurity object
        ///     that describes the file's access control list (ACL) information.
        /// </param>
        /// <exception cref="ArgumentNullException">The path parameter is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="IOException">An I/O error occurred while opening the directory.</exception>
        /// <exception cref="PlatformNotSupportedException">The current operating system is not Windows NT or later.</exception>
        /// <exception cref="SystemException">The directory could not be found.</exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <returns>
        ///     A DirectorySecurity object that encapsulates the access control rules
        ///     for the file described by the path parameter.
        /// </returns>
        [DebuggerHidden]
        DirectorySecurity IDirectory.GetAccessControl(string path)
        {
            return global::System.IO.Directory.GetAccessControl(path);
        }

        /// <summary>
        ///     Gets a DirectorySecurity object that encapsulates the access control list (ACL)
        ///     entries for a specified directory.
        /// </summary>
        /// <param name="path">
        ///     The path to a directory containing a DirectorySecurity object
        ///     that describes the file's access control list (ACL) information.
        /// </param>
        /// <param name="includeSections">
        ///     One of the AccessControlSections values that specifies the type of
        ///     access control list (ACL) information to receive.
        /// </param>
        /// <exception cref="ArgumentNullException">The path parameter is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="IOException">An I/O error occurred while opening the directory.</exception>
        /// <exception cref="PlatformNotSupportedException">The current operating system is not Windows NT or later.</exception>
        /// <exception cref="SystemException">The directory could not be found.</exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <returns>
        ///     A DirectorySecurity object that encapsulates the access control rules
        ///     for the file described by the path parameter.
        /// </returns>
        [DebuggerHidden]
        DirectorySecurity IDirectory.GetAccessControl(string path, AccessControlSections includeSections)
        {
            return global::System.IO.Directory.GetAccessControl(path, includeSections);
        }

        /// <summary>
        ///     Applies access control list (ACL) entries described by a DirectorySecurity object to the specified directory.
        /// </summary>
        /// <param name="path">A directory to add or remove access control list (ACL) entries from.</param>
        /// <param name="directorySecurity">
        ///     A DirectorySecurity object that describes an ACL entry to apply to the directory
        ///     described by the path parameter.
        /// </param>
        /// <exception cref="ArgumentNullException">The path parameter is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="DirectoryNotFoundException">
        ///     <para>The current process does not have access to the directory specified by path.</para>
        ///     <para>or</para>
        ///     <para>The current process does not have sufficient privilege to set the ACL entry.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="PlatformNotSupportedException">The current operating system is not Windows NT or later.</exception>
        [DebuggerHidden]
        void IDirectory.SetAccessControl(string path, DirectorySecurity directorySecurity)
        {
            global::System.IO.Directory.SetAccessControl(path, directorySecurity);
        }

        /// <summary>
        ///     Returns the names of files (including their paths) in the specified directory.
        /// </summary>
        /// <param name="path">The directory from which to retrieve the files.</param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        ///     <para>or</para>
        ///     <para>A network error has occurred.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>A String array of file names in the specified directory.</returns>
        [DebuggerHidden]
        string[] IDirectory.GetFiles(string path)
        {
            return global::System.IO.Directory.GetFiles(path);
        }

        /// <summary>
        ///     Returns the names of files (including their paths) that match the specified search pattern in the specified
        ///     directory.
        /// </summary>
        /// <param name="path">The directory from which to retrieve the files.</param>
        /// <param name="searchPattern">
        ///     The search string to match against the names of files in path.
        ///     The parameter cannot end in two periods ("..") or contain two periods ("..") followed by DirectorySeparatorChar or
        ///     AltDirectorySeparatorChar, nor can it contain any of the characters in InvalidPathChars.
        /// </param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        ///     <para>or</para>
        ///     <para>A network error has occurred.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>
        ///     A String array containing the names of files in the specified directory that match the specified search pattern.
        ///     File names include the full path.
        /// </returns>
        [DebuggerHidden]
        string[] IDirectory.GetFiles(string path, string searchPattern)
        {
            return global::System.IO.Directory.GetFiles(path, searchPattern);
        }

        /// <summary>
        ///     Returns the names of files (including their paths) that match the specified search pattern
        ///     in the specified directory, using a value to determine whether to search subdirectories.
        /// </summary>
        /// <param name="path">The directory from which to retrieve the files.</param>
        /// <param name="searchPattern">
        ///     The search string to match against the names of files in path.
        ///     The parameter cannot end in two periods ("..") or contain two periods ("..") followed by DirectorySeparatorChar or
        ///     AltDirectorySeparatorChar, nor can it contain any of the characters in InvalidPathChars.
        /// </param>
        /// <param name="searchOption">
        ///     One of the SearchOption values that specifies whether the search operation should
        ///     include all subdirectories or only the current directory.
        /// </param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        ///     <para>or</para>
        ///     <para>A network error has occurred.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>
        ///     A String array containing the names of files in the specified directory that match the specified search pattern.
        ///     File names include the full path.
        /// </returns>
        [DebuggerHidden]
        string[] IDirectory.GetFiles(string path, string searchPattern, SearchOption searchOption)
        {
            return global::System.IO.Directory.GetFiles(path, searchPattern, Convert(searchOption));
        }

        /// <summary>
        ///     Gets the names of subdirectories (including their paths) in the specified directory.
        /// </summary>
        /// <param name="path">The path for which an array of subdirectory names is returned.</param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>An array of the names of subdirectories in path.</returns>
        [DebuggerHidden]
        string[] IDirectory.GetDirectories(string path)
        {
            return global::System.IO.Directory.GetDirectories(path);
        }

        /// <summary>
        ///     Gets an array of directories (including their paths) that match the specified search pattern in the current
        ///     directory.
        /// </summary>
        /// <param name="path">The path for which an array of subdirectory names is returned.</param>
        /// <param name="searchPattern">
        ///     The search string to match against the names of files in path.
        ///     The parameter cannot end in two periods ("..") or contain two periods ("..") followed by DirectorySeparatorChar or
        ///     AltDirectorySeparatorChar, nor can it contain any of the characters in InvalidPathChars.
        /// </param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>A String array of directories that match the search pattern.</returns>
        [DebuggerHidden]
        string[] IDirectory.GetDirectories(string path, string searchPattern)
        {
            return global::System.IO.Directory.GetDirectories(path, searchPattern);
        }

        /// <summary>
        ///     Gets the names of the directories (including their paths) that match the specified search pattern in the current
        ///     directory,
        ///     and optionally searches subdirectories.
        /// </summary>
        /// <param name="path">The path for which an array of subdirectory names is returned.</param>
        /// <param name="searchPattern">
        ///     The search string to match against the names of files in path.
        ///     The parameter cannot end in two periods ("..") or contain two periods ("..") followed by DirectorySeparatorChar or
        ///     AltDirectorySeparatorChar, nor can it contain any of the characters in InvalidPathChars.
        /// </param>
        /// <param name="searchOption">
        ///     One of the SearchOption values that specifies whether the search operation
        ///     should include all subdirectories or only the current directory.
        /// </param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>A String array of directories that match the search pattern.</returns>
        [DebuggerHidden]
        string[] IDirectory.GetDirectories(string path, string searchPattern, SearchOption searchOption)
        {
            return global::System.IO.Directory.GetDirectories(path, searchPattern, Convert(searchOption));
        }

        /// <summary>
        ///     Returns the names of all files and subdirectories in the specified directory.
        /// </summary>
        /// <param name="path">The directory for which file and subdirectory names are returned.</param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>An array that contains the names of files and subdirectories in the specified directory.</returns>
        [DebuggerHidden]
        string[] IDirectory.GetFileSystemEntries(string path)
        {
            return global::System.IO.Directory.GetFileSystemEntries(path);
        }

        /// <summary>
        ///     Returns an array of file system entries that match the specified search criteria.
        /// </summary>
        /// <param name="path">The directory for which file and subdirectory names are returned.</param>
        /// <param name="searchPattern">
        ///     The search string to match against the names of files in path.
        ///     The searchPattern parameter cannot end in two periods ("..") or contain two periods ("..") followed by
        ///     DirectorySeparatorChar
        ///     or AltDirectorySeparatorChar, nor can it contain any of the characters in InvalidPathChars.
        /// </param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>An array of file system entries that match the search criteria.</returns>
        [DebuggerHidden]
        string[] IDirectory.GetFileSystemEntries(string path, string searchPattern)
        {
            return global::System.IO.Directory.GetFileSystemEntries(path, searchPattern);
        }

        /// <summary>
        ///     Gets an array of all the file names and directory names that match a search pattern in a specified path, and
        ///     optionally searches subdirectories.
        /// </summary>
        /// <param name="path">The directory for which file and subdirectory names are returned.</param>
        /// <param name="searchPattern">
        ///     The search string to match against the names of files in path.
        ///     The searchPattern parameter cannot end in two periods ("..") or contain two periods ("..") followed by
        ///     DirectorySeparatorChar
        ///     or AltDirectorySeparatorChar, nor can it contain any of the characters in InvalidPathChars.
        /// </param>
        /// <param name="searchOption">
        ///     The option that specifies whether the search operation should include only the current directory or should include
        ///     all subdirectories.
        ///     The default value is TopDirectoryOnly.
        /// </param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>An array of file system entries that match the search criteria.</returns>
        [DebuggerHidden]
        string[] IDirectory.GetFileSystemEntries(string path, string searchPattern, SearchOption searchOption)
        {
            return global::System.IO.Directory.GetFileSystemEntries(path, searchPattern, Convert(searchOption));
        }

        /// <summary>
        ///     Returns an enumerable collection of directory names in a specified path.
        /// </summary>
        /// <param name="path">The directory to search.</param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>An enumerable collection of directory names in the directory specified by path.</returns>
        [DebuggerHidden]
        IEnumerable<string> IDirectory.EnumerateDirectories(string path)
        {
            return global::System.IO.Directory.EnumerateDirectories(path);
        }

        /// <summary>
        ///     Returns an enumerable collection of directory names that match a search pattern in a specified path.
        /// </summary>
        /// <param name="path">The directory to search.</param>
        /// <param name="searchPattern">The search string to match against the names of directories in path.</param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>An enumerable collection of directory names in the directory specified by path and that match searchPattern.</returns>
        [DebuggerHidden]
        IEnumerable<string> IDirectory.EnumerateDirectories(string path, string searchPattern)
        {
            return global::System.IO.Directory.EnumerateDirectories(path, searchPattern);
        }

        /// <summary>
        ///     Returns an enumerable collection of directory names that match a search pattern in a specified path, and optionally
        ///     searches subdirectories.
        /// </summary>
        /// <param name="path">The directory to search.</param>
        /// <param name="searchPattern">The search string to match against the names of directories in path.</param>
        /// <param name="searchOption">
        ///     One of the values of the SearchOption enumeration that specifies whether the search operation should
        ///     include only the current directory or should include all subdirectories.
        ///     The default value is TopDirectoryOnly.
        /// </param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>
        ///     An enumerable collection of directory names in the directory specified by path and that match searchPattern
        ///     and searchOption.
        /// </returns>
        [DebuggerHidden]
        IEnumerable<string> IDirectory.EnumerateDirectories(string path, string searchPattern, SearchOption searchOption)
        {
            return global::System.IO.Directory.EnumerateDirectories(path, searchPattern, Convert(searchOption));
        }

        /// <summary>
        ///     Returns an enumerable collection of file names in a specified path.
        /// </summary>
        /// <param name="path">The directory to search.</param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>An enumerable collection of file names in the directory specified by path.</returns>
        [DebuggerHidden]
        IEnumerable<string> IDirectory.EnumerateFiles(string path)
        {
            return global::System.IO.Directory.EnumerateFiles(path);
        }

        /// <summary>
        ///     Returns an enumerable collection of file names that match a search pattern in a specified path.
        /// </summary>
        /// <param name="path">The directory to search.</param>
        /// <param name="searchPattern">The search string to match against the names of directories in path.</param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>An enumerable collection of file names in the directory specified by path and that match searchPattern.</returns>
        [DebuggerHidden]
        IEnumerable<string> IDirectory.EnumerateFiles(string path, string searchPattern)
        {
            return global::System.IO.Directory.EnumerateFiles(path, searchPattern);
        }

        /// <summary>
        ///     Returns an enumerable collection of file names that match a search pattern in a specified path, and optionally
        ///     searches subdirectories.
        /// </summary>
        /// <param name="path">The directory to search.</param>
        /// <param name="searchPattern">The search string to match against the names of directories in path.</param>
        /// <param name="searchOption">
        ///     One of the values of the SearchOption enumeration that specifies whether the search operation should
        ///     include only the current directory or should include all subdirectories.
        ///     The default value is TopDirectoryOnly.
        /// </param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>
        ///     An enumerable collection of file names in the directory specified by path and that match searchPattern and
        ///     searchOption.
        /// </returns>
        [DebuggerHidden]
        IEnumerable<string> IDirectory.EnumerateFiles(string path, string searchPattern, SearchOption searchOption)
        {
            return global::System.IO.Directory.EnumerateFiles(path, searchPattern, Convert(searchOption));
        }

        /// <summary>
        ///     Returns an enumerable collection of file-system entries in a specified path.
        /// </summary>
        /// <param name="path">The directory to search.</param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>An enumerable collection of file-system entries in the directory specified by path.</returns>
        [DebuggerHidden]
        IEnumerable<string> IDirectory.EnumerateFileSystemEntries(string path)
        {
            return global::System.IO.Directory.EnumerateFileSystemEntries(path);
        }

        /// <summary>
        ///     Returns an enumerable collection of file-system entries that match a search pattern in a specified path.
        /// </summary>
        /// <param name="path">The directory to search.</param>
        /// <param name="searchPattern">The search string to match against the names of directories in path.</param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>
        ///     An enumerable collection of file-system entries in the directory specified by path and that match
        ///     searchPattern.
        /// </returns>
        [DebuggerHidden]
        IEnumerable<string> IDirectory.EnumerateFileSystemEntries(string path, string searchPattern)
        {
            return global::System.IO.Directory.EnumerateFileSystemEntries(path, searchPattern);
        }

        /// <summary>
        ///     Returns an enumerable collection of file names and directory names that match a search pattern in a specified path,
        ///     and optionally searches subdirectories.
        /// </summary>
        /// <param name="path">The directory to search.</param>
        /// <param name="searchPattern">The search string to match against the names of directories in path.</param>
        /// <param name="searchOption">
        ///     One of the values of the SearchOption enumeration that specifies whether the search operation should
        ///     include only the current directory or should include all subdirectories.
        ///     The default value is TopDirectoryOnly.
        /// </param>
        /// <exception cref="IOException">
        ///     <para>path is a file name.</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <exception cref="ArgumentNullException">path is a null reference (Nothing in Visual Basic).</exception>
        /// <exception cref="PathTooLongException">
        ///     The specified path, file name, or both exceed the system-defined maximum length.
        ///     For example, on Windows-based platforms, paths must be less than 248 characters
        ///     and file names must be less than 260 characters.
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
        /// <returns>
        ///     An enumerable collection of file-system entries in the directory specified by path and that match
        ///     searchPattern and searchOption.
        /// </returns>
        [DebuggerHidden]
        IEnumerable<string> IDirectory.EnumerateFileSystemEntries(string path, string searchPattern,
            SearchOption searchOption)
        {
            return global::System.IO.Directory.EnumerateFileSystemEntries(path, searchPattern, Convert(searchOption));
        }

        /// <summary>
        ///     Retrieves the names of the logical drives on this computer in the form "drive letter:\".
        /// </summary>
        /// <exception cref="IOException">
        ///     <para>An I/O error occured (for example, a disk error).</para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">The caller does not have the required permission.</exception>
        /// <exception cref="ArgumentException">
        ///     path is a zero-length string, contains only white space,
        ///     or contains one or more invalid characters as defined by InvalidPathChars.
        /// </exception>
        /// <returns>The logical drives on this computer.</returns>
        [DebuggerHidden]
        string[] IDirectory.GetLogicalDrives()
        {
            return global::System.IO.Directory.GetLogicalDrives();
        }

        /// <summary>
        ///     <para>
        ///         Returns the volume information, root information, or both for the specified path.
        ///     </para>
        /// </summary>
        /// <param name="path">The path to use</param>
        /// <exception cref="UnauthorizedAccessException">
        ///     <para>
        ///         The caller does not have the required permission.
        ///     </para>
        /// </exception>
        /// <exception cref="ArgumentException">
        ///     <para>
        ///         path is a zero-length string, contains only white space,
        ///         or contains one or more invalid characters as defined by InvalidPathChars.
        ///     </para>
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     <para>
        ///         path is a null reference (Nothing in Visual Basic).
        ///     </para>
        /// </exception>
        /// <exception cref="PathTooLongException">
        ///     <para>
        ///         The specified path, file name, or both exceed the system-defined maximum length.
        ///         For example, on Windows-based platforms, paths must be less than 248 characters and
        ///         file names must be less than 260 characters.
        ///     </para>
        /// </exception>
        /// <returns>
        ///     <para>
        ///         A string containing the volume information, root information, or both for the specified path.
        ///     </para>
        /// </returns>
        [DebuggerHidden]
        string IDirectory.GetDirectoryRoot(string path)
        {
            return global::System.IO.Directory.GetDirectoryRoot(path);
        }

        /// <summary>
        ///     <para>
        ///         Gets the current working directory of the application.
        ///     </para>
        /// </summary>
        /// <exception cref="UnauthorizedAccessException">
        ///     <para>
        ///         The caller does not have the required permission.
        ///     </para>
        /// </exception>
        /// <exception cref="NotSupportedException">
        ///     <para>
        ///         The operating system is Windows CE, which does not have current directory functionality.
        ///         This method is available in the .NET Compact Framework, but is not currently supported.
        ///     </para>
        /// </exception>
        /// <returns>
        ///     <para>
        ///         A string that contains the path of the current working directory, and does not end with a backslash (\).
        ///     </para>
        /// </returns>
        [DebuggerHidden]
        string IDirectory.GetCurrentDirectory()
        {
            return global::System.IO.Directory.GetCurrentDirectory();
        }

        /// <summary>
        ///     <para>
        ///         Sets the application's current working directory to the specified directory.
        ///     </para>
        /// </summary>
        /// <param name="path">The path to use</param>
        /// <exception cref="IOException">
        ///     <para>
        ///         An I/O error occurred.
        ///     </para>
        /// </exception>
        /// <exception cref="ArgumentException">
        ///     <para>
        ///         path is a zero-length string, contains only white space, or contains one or more invalid characters as defined
        ///         by InvalidPathChars.
        ///     </para>
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     <para>
        ///         path is a null reference (Nothing in Visual Basic).
        ///     </para>
        /// </exception>
        /// <exception cref="PathTooLongException">
        ///     <para>
        ///         The specified path, file name, or both exceed the system-defined maximum length.
        ///         For example, on Windows-based platforms, paths must be less than 248 characters and
        ///         file names must be less than 260 characters.
        ///     </para>
        /// </exception>
        /// <exception cref="SecurityException">
        ///     <para>
        ///         The caller does not have the required permission to access unmanaged code.
        ///     </para>
        /// </exception>
        /// <exception cref="FileNotFoundException">
        ///     <para>
        ///         The specified path was not found.
        ///     </para>
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">
        ///     <para>
        ///         The specified directory was not found.
        ///     </para>
        /// </exception>
        [DebuggerHidden]
        void IDirectory.SetCurrentDirectory(string path)
        {
            global::System.IO.Directory.SetCurrentDirectory(path);
        }

        /// <summary>
        ///     <para>
        ///         Moves a file or a directory and its contents to a new location.
        ///     </para>
        /// </summary>
        /// <param name="sourceDirName">where from</param>
        /// <param name="destDirName">where to</param>
        /// <exception cref="IOException">
        ///     <para>
        ///         An I/O error occurred.
        ///     </para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">
        ///     <para>
        ///         The caller does not have the required permission.
        ///     </para>
        /// </exception>
        /// <exception cref="ArgumentException">
        ///     <para>
        ///         path is a zero-length string, contains only white space, or contains one or more invalid characters as defined
        ///         by InvalidPathChars.
        ///     </para>
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     <para>
        ///         path is a null reference (Nothing in Visual Basic).
        ///     </para>
        /// </exception>
        /// <exception cref="PathTooLongException">
        ///     <para>
        ///         The specified path, file name, or both exceed the system-defined maximum length.
        ///         For example, on Windows-based platforms, paths must be less than 248 characters and
        ///         file names must be less than 260 characters.
        ///     </para>
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">
        ///     <para>
        ///         The specified directory was not found.
        ///     </para>
        /// </exception>
        [DebuggerHidden]
        void IDirectory.Move(string sourceDirName, string destDirName)
        {
            global::System.IO.Directory.Move(sourceDirName, destDirName);
        }

        /// <summary>
        ///     <para>
        ///         Deletes an empty directory from a specified path.
        ///     </para>
        /// </summary>
        /// <param name="path">The name of the directory to remove.</param>
        /// <exception cref="IOException">
        ///     <para>
        ///         A file with the same name and location specified by path exists.
        ///     </para>
        ///     <para>- or -</para>
        ///     <para>
        ///         The directory is the application's current working directory.
        ///     </para>
        ///     <para>- or -</para>
        ///     <para>
        ///         The directory specified by path is not empty.
        ///     </para>
        ///     <para>- or -</para>
        ///     <para>
        ///         The directory is read-only or contains a read-only file.
        ///     </para>
        ///     <para>- or -</para>
        ///     <para>
        ///         The directory is being used by another process.
        ///     </para>
        ///     <para>- or -</para>
        ///     <para>
        ///         There is an open handle on the directory, and the operating system is Windows XP or earlier.
        ///         This open handle can result from directories.
        ///         For more information, see How to: Enumerate Directories and Files.
        ///     </para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">
        ///     <para>
        ///         The caller does not have the required permission.
        ///     </para>
        /// </exception>
        /// <exception cref="ArgumentException">
        ///     <para>
        ///         path is a zero-length string, contains only white space, or contains one or more invalid characters as defined
        ///         by InvalidPathChars.
        ///     </para>
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     <para>
        ///         path is a null reference (Nothing in Visual Basic).
        ///     </para>
        /// </exception>
        /// <exception cref="PathTooLongException">
        ///     <para>
        ///         The specified path, file name, or both exceed the system-defined maximum length.
        ///         For example, on Windows-based platforms, paths must be less than 248 characters and
        ///         file names must be less than 260 characters.
        ///     </para>
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">
        ///     <para>
        ///         The specified directory was not found.
        ///     </para>
        /// </exception>
        [DebuggerHidden]
        void IDirectory.Delete(string path)
        {
            global::System.IO.Directory.Delete(path);
        }

        /// <summary>
        ///     <para>
        ///         Deletes the specified directory and, if indicated, any subdirectories and files in the directory.
        ///     </para>
        /// </summary>
        /// <param name="path">The name of the directory to remove.</param>
        /// <param name="recursive">true to remove directories, subdirectories, and files in path; otherwise, false. </param>
        /// <exception cref="IOException">
        ///     <para>
        ///         A file with the same name and location specified by path exists.
        ///     </para>
        ///     <para>- or -</para>
        ///     <para>
        ///         The directory is the application's current working directory.
        ///     </para>
        ///     <para>- or -</para>
        ///     <para>
        ///         The directory specified by path is not empty.
        ///     </para>
        ///     <para>- or -</para>
        ///     <para>
        ///         The directory is read-only or contains a read-only file.
        ///     </para>
        ///     <para>- or -</para>
        ///     <para>
        ///         The directory is being used by another process.
        ///     </para>
        ///     <para>- or -</para>
        ///     <para>
        ///         There is an open handle on the directory, and the operating system is Windows XP or earlier.
        ///         This open handle can result from directories.
        ///         For more information, see How to: Enumerate Directories and Files.
        ///     </para>
        /// </exception>
        /// <exception cref="UnauthorizedAccessException">
        ///     <para>
        ///         The caller does not have the required permission.
        ///     </para>
        /// </exception>
        /// <exception cref="ArgumentException">
        ///     <para>
        ///         path is a zero-length string, contains only white space, or contains one or more invalid characters as defined
        ///         by InvalidPathChars.
        ///     </para>
        /// </exception>
        /// <exception cref="ArgumentNullException">
        ///     <para>
        ///         path is a null reference (Nothing in Visual Basic).
        ///     </para>
        /// </exception>
        /// <exception cref="PathTooLongException">
        ///     <para>
        ///         The specified path, file name, or both exceed the system-defined maximum length.
        ///         For example, on Windows-based platforms, paths must be less than 248 characters and
        ///         file names must be less than 260 characters.
        ///     </para>
        /// </exception>
        /// <exception cref="DirectoryNotFoundException">
        ///     <para>
        ///         The specified directory was not found.
        ///     </para>
        /// </exception>
        [DebuggerHidden]
        void IDirectory.Delete(string path, bool recursive)
        {
            global::System.IO.Directory.Delete(path, recursive);
        }

        #endregion

        /// <summary>
        ///     Converts the specified directory info.
        /// </summary>
        /// <param name="directoryInfo">The directory info.</param>
        /// <returns>the converted object</returns>
        [DebuggerHidden]
        private IDirectoryInfo Convert(global::System.IO.DirectoryInfo directoryInfo)
        {
            return IoConverter.Convert(directoryInfo);
        }

        /// <summary>
        ///     Converts the specified directory info.
        /// </summary>
        /// <param name="searchOption">The Search option.</param>
        /// <returns>the converted object</returns>
        [DebuggerHidden]
        private global::System.IO.SearchOption Convert(SearchOption searchOption)
        {
            return IoConverter.Convert(searchOption);
        }
    }
}